<%@page import="com.team.entity.Document"%>
<%@page import="com.team.entity.Goal"%>
<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ page import="com.team.entity.User" %>
 <%@ page import="com.team.util.Const" %>
 
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<head>
	<meta http-equiv="Content-Type" content="text/html;charset=UTF-8" />
	<title>编辑资料</title>
	<link rel="stylesheet" href="css/prettify.css" />
    <link rel="stylesheet" href="css/bootstrap.min.css" />
    <script type="text/javascript" src="js/jquery.js"></script>
</head>
<body class="body">
<% 
	User user = (User)session.getAttribute(Const.SESSION_USER); 
 %>
	<div class="navbar navbar-fixed-top">
		<div class="navbar-inner">
			<div class="container">
				<a href="#" class="brand">凯盛项目管理系统</a>
				 <ul class="nav pull-right">
						<li><a class="nav pull-right" href="#">用户名： <%=user.getUsername() %></a></li>
				 </ul>
			</div>
		</div>
	</div>
<div class="container">
	  <div class="row">
		<div class="span9">
		
		 <c:choose>
			<c:when test="${param.code=='1001'}">
				<div style="color:red;">内容不可以为空</div>
			</c:when>
			<c:when test="${param.code=='1002'}">
				<div style="color:red;">请先登录</div>
			</c:when>
			<c:when test="${param.code=='1003'}">
				<div style="color:red;">此用户不存在</div>
			</c:when>
			<c:when test="${param.code=='1004'}">
				<div style="color:red;">用户名或密码错误</div>
			</c:when>
		</c:choose>
		
		<%
			Document doc = (Document)session.getAttribute(Const.SESSION_EDITDOC);
			if(doc == null){
		 %>
		 <div style="color:red;">doc is null</div>
		 <%}else { %>
			<form class="form-horizontal" action ="docShare.jspx?_m=update&id=<%=doc.getId() %>" method="post">
	        <fieldset>
	          <legend>编辑资料</legend>
	          <div class="control-group">
	            <label for="input01" class="control-label">资料名称</label>
	            <div class="controls">
	              <input type="text"name="name" x-webkit-speech="undefined" id="input01" class="span5" value=<%=doc.getTitle() %> />
	              <p class="help-block">In addition to freeform text, any HTML5 text-based input appears like so.</p>
	            </div>
	          </div>
	          <div class="control-group">
	            <label for="input01" class="control-label">资料描述</label>
	            <div class="controls">
	              <textarea rows="8" class="span5" name="content" > <%=doc.getContext() %> </textarea>
	            </div>
	          </div>
	          <%} %>
	          <div class="form-actions">
	            <button class="btn btn-primary" type="submit">保存</button>
	           <a href="goal.jsp" class="btn">返回</a>
	          </div>
	        </fieldset>
      </form>          
          	
		</div>
		<div class="span3">
			
		</div>
	  </div>
	</div>
	
	
	
</body>
</html>